package cn.buddha.jec.util;

import cn.buddha.jec.exception.TongBusinessException;
import cn.buddha.jec.exception.enums.TongExceptionEnum;

/**
 * @ClassName TongBusinessUtils
 * @Author 友野浩二
 * @Description 业务工具类
 */
public class TongBusinessUtils {

    /**
     * @return com.tong.hao.common.exception.TongBusinessException
     * @Author 友野浩二
     * @Description // 创建业务异常
     * @Param [exceptionCode, exceptionMessage]
     **/
    public static TongBusinessException createBusinessException(String exceptionCode, String exceptionMessage) {
        return new TongBusinessException(exceptionCode, exceptionMessage);
    }

    /**
     * 创建业务异常
     *
     * @param tongExceptionEnum 业务异常枚举类
     * @return cn.buddha.jec.exception.TongBusinessException
     * @author shihao
     */
    public static TongBusinessException createBusinessException(TongExceptionEnum tongExceptionEnum) {
        return new TongBusinessException(tongExceptionEnum.getCode(), tongExceptionEnum.getMessage());
    }

}
